<script lang="ts" setup>
const { pList } = defineProps(['pList'])
</script>

<template>
    <div class="search-result-item" @click="$router.push({name:'playDetail',params: {pid: pList.performanceId}})">
        <img :src="pList.posterUrl" alt="">
        <div class="search-result-con">
            <div>
                <div class="search-result-title">{{ pList.name }}</div>
                <div class="search-result-score">
                    <div class="result-score" v-show="pList.score != '0.0'">{{ pList.score }}</div>
                    <div class="result-label" v-if="pList.billBoardVO">{{ pList.billBoardVO?.billBoardTitle }}</div>
                </div>
                <div class="search-result-time">{{ pList.showTimeRange }}</div>
                <div class="search-result-address">{{ pList.cityName }} {{ pList.shopName }}</div>
            </div>
            <div class="search-result-price">
               <a class="seat-type">{{ pList.seatType == "0"?"售票中":"选座购票" }}</a> 
                {{ pList.priceRange }} 元
            </div>
        </div>
    </div>
</template>

<style lang="scss" scoped>
.search-result-item{
    width: 100vw;
    height: 44vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4vw;
    box-sizing: border-box;
    background-color: #ffffff;

    img{
        width: 26vw;
        height: 35vw;
        border-radius: 2vw;
    }

    .search-result-con{
        color: #888888;
        font-size: 13px;
        width: 64vw;
        height: 34vw;
        display: flex;
        flex-wrap: wrap;
        align-content: space-between;
        
        .search-result-title{
            width: 64vw;
            color: #222222;
            line-height: 6vw;
            font-size: 4.5vw;
            font-weight: bold;
            -webkit-box-orient: vertical;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            text-overflow: ellipsis;
            overflow: hidden;
        }
        .search-result-score{
            color: #ff913d;
            font-size: 13px;
            font-weight: bolder;
            font-family: MaoYanHeiTi-H;
            display: flex;
            margin: 1.2vw 0;

            div{
                border-right: #d8d8d8 1px solid;

                &:last-of-type{
                    border: none;
                }
            }
            
            .result-score{
                padding-right: 2vw;
                margin-right: 2vw;
            }
            .result-label{
                color: #d5821d;
            }
        }
        .search-result-time{
            margin: 1.6vw 0;
        }
        .search-result-address{
            width: 64vw;
            -webkit-box-orient: vertical;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            text-overflow: ellipsis;
            overflow: hidden;
        }
        .search-result-price{
            color: #000000;

            .seat-type{
                display: inline-block;
                color: #ff6a48;
                padding: 1px 3px;
                border-radius: 2px;
                background: #fff1ef;
            }
        }
    }
}
</style>